/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package javaapplication3;
import java.io.*;

/**
 *
 * @author User
 */

public class Main {
    public static final int MAX=1000;
    /**
     * @param args the command line arguments
     */
 public static   void Merge(int Mas[], int left, int right, int medium)
{
        int j = left;
        int k = medium + 1;
        int count = right - left + 1;

        if (count <= 1) return;

        int [] TmpMas = new int[count];

        for (int i = 0; i < count; i++)
        {
                if (j <= medium && k <= right)
                {
                        if (Mas[j] < Mas[k])
        TmpMas[i] = Mas[j++];
                        else
        TmpMas[i] = Mas[k++];
                }
                else
                {
                        if (j <= medium)
        TmpMas[i] = Mas[j++];
                        else
        TmpMas[i] = Mas[k++];
                }
        }

        j = 0;
        for (int i = left; i <= right; i++)
        {
                Mas[i] = TmpMas[j++];
        }

}


public static void MergeSort(int a[], int l, int r)
{
        int m;

        if(l >= r) return;

        m = (l + r) / 2;

        MergeSort(a, l, m);
        MergeSort(a, m + 1, r);
        Merge(a, l, r, m);
}
public static void main(String[] args) throws IOException
{

	int [] a=new int[MAX];
	int i=0;
	BufferedReader in = new BufferedReader(new FileReader("D:/in.txt"));
        String s,s2 = new String();
        while((s=in.readLine())!=null)
        {
            s2=s+"\n";
        }
        int end = s2.lastIndexOf('\n');
        int cur=0;
        int q;
        while(cur<end)
        {
            q=cur;
            while(s2.charAt(q)!=' ' && q<end) q++;
            s=s2.substring(cur,q);
            a[i]=Integer.parseInt(s);
            i++;
            while((s2.charAt(q)==' ' || s2.charAt(q)=='\n') && q<end) q++;
            cur=q;
        }
        in.close();
	MergeSort(a,0,i-1);
	PrintWriter out=new PrintWriter(new BufferedWriter(new FileWriter("D:/out.txt")));
        for(q=0;q<i;q++) out.print(a[q] + " ");
        out.close();
}


}
